<template>
  <view class="c-pd">
    <OrderGoodsCard :data="data.info" />
    <view class="mt-3">
      <TypeDetailCard :data="data.info"></TypeDetailCard>
    </view>
  </view>
</template>

<script setup lang="ts">
import UserRequest from '@/request/userRequest';
import TypeDetailCard from '../component/TypeDetailCard.vue';

interface IData {
  info?: IMoneyManagementList;
  splitInfoId: number;
}

const data = reactive<IData>({
  splitInfoId: 0,
});

onLoad((options) => {
  if (!options) return;
  data.splitInfoId = options.splitInfoId;
  getDetailInfo();
});

const getDetailInfo = () => {
  UserRequest.GetMoneyDetailInfo({ id: data.splitInfoId, hasLoading: true }).then((res) => {
    data.info = res.data as IMoneyManagementList;
  });
};
</script>
